package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.PermissionDao;
import com.itheima.pojo.Permission;
import com.itheima.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.Set;

/**
 * @author hql
 * @date 2019-12-11 19:22
 */
@Service(interfaceClass =PermissionService.class)
@Transactional
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionDao permissionDao;
    /**
     * 根据角色id查询所有的权限信息
     * @param id
     * @return
     */
    @Override
    public Set<Permission> findByRoleId(Integer id) {
        Set<Permission> permissionSet = permissionDao.findByRoleId(id);
        return permissionSet;
    }
}
